Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(aws-s3-deployment): Cleanup temp directory after sync #1367

Merged
merged 1 commit into from
Jan 15, 2019

Conversation

dnakov
Copy link
Contributor

@dnakov dnakov commented Dec 14, 2018

The deployment lambda function tmp dir can get filled up and errors out with "no disk space left" if it's warm.


Pull Request Checklist

Please check all boxes, including N/A items:

Testing

  • Unit test and/or integration test added
  • Toolkit change?: integration tests manually executed (paste output to the PR description)
  • Init template change?: coordinated update of integration tests (currently maintained in a private repo).

Documentation

  • README: README and/or documentation topic updated
  • jsdocs: All public APIs documented

Title and description

  • Change type: Title is prefixed with change type:
    • fix(module): <title> bug fix (patch)
    • feat(module): <title> feature/capability (minor)
    • chore(module): <title> won't appear in changelog
    • build(module): <title> won't appear in changelog
  • Title format: Title uses lower case and doesn't end with a period
  • Breaking change?: Last paragraph of description is: BREAKING CHANGE: <describe exactly what changed and how to achieve similar behavior + link to documentation/gist/issue if more details are required>
  • References: Indicate issues fixed via: Fixes #xxx or Closes #xxx

By submitting this pull request, I confirm that my contribution is made under the terms of the Apache-2.0 license.

It can get filled up and errors out with "no disk space left" if the lambda function is warm
@dnakov dnakov requested a review from a team as a code owner December 14, 2018 15:11
@RomainMuller
Copy link
Contributor

Oh that's a nice suggestion - however I would rather switch to an implementation that leverages:

with tempfile.TemporaryDirectory() as workdir:
    # The stuff

This would guarantee the temporary directory gets cleaned, even if an error is thrown, and that's a little more elegant than writing a try ... catch.

What do you think?

@RomainMuller RomainMuller changed the title aws-s3-deployment lambda: cleanup temp directory after sync feat(aws-s3-deployment): Cleanup temp directory after sync Dec 14, 2018
@RomainMuller RomainMuller self-assigned this Dec 14, 2018
@dnakov
Copy link
Contributor Author

dnakov commented Dec 17, 2018

@RomainMuller I can add it but it seems redundant -- the code above ensures that directory will exist

@rix0rrr
Copy link
Contributor

rix0rrr commented Dec 27, 2018

I can add it but it seems redundant -- the code above ensures that directory will exist

That would then also replace the mkdir

@srchase srchase added feature-request A feature should be added or improved. and removed enhancement labels Jan 3, 2019
Copy link
Contributor

@rix0rrr rix0rrr left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Approving on the grounds that this at least makes the situation better (even if still not ideal).

@rix0rrr rix0rrr merged commit e291d37 into aws:master Jan 15, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature-request A feature should be added or improved.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants